<template>
  <div class="container">
    <el-button @click="toPower">权限页面</el-button>
    <el-button @click="toLogout">退出登录</el-button>
    <el-button v-permission="{role:['admin', 'student']}">都能看见</el-button>
    <el-button v-permission="{role:['admin']}">管理员能看见</el-button>
    <el-button v-permission="{role:['student']}">学生能看见</el-button>
  </div>
</template>

<script>
import { removeToken } from '@/utils/auth'
export default {
  name: 'HomeIndex',
  components: {},
  props: {},
  data () {
    return {

    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    toPower () {
      this.$router.push({
        path: '/power'
      })
    },
    toLogout () {
      this.$router.push('/login')
      removeToken()
      window.location.reload() // 刷新vuex
    }
  }
}
</script>

<style scoped lang="">

</style>
